// import React, { useEffect, useState } from 'react'
import React, { useState, useEffect } from "react";
import { youtndetail } from "./sevice/postQuery";
import { NavBar } from "react-vant";
import { Cell } from "react-vant";
import { Card } from "react-vant";
import { Swiper } from "react-vant";
import "./css/base.less";
// import style from "./css/Home.css";
import style from "./css/Home.module.css";
// import {  } from '@react-vant/icons'
import { Button, Space, Image } from "react-vant";
import { Arrow, Like } from "@react-vant/icons";
export default function Postdetail() {
  let id = window.localStorage.getItem("btnid");
  console.log(id, "lallala");
  let [data, setList] = useState();

  useEffect(() => {
    (async () => {
      let { data } = await youtndetail(id);
      console.log(data, "原始数据");
      // setList(data.data)
      setList(data?.data);
    })();
  }, []);
  useEffect(() => {
    console.log(data, "对象");
  }, [data]);
  return (
    <div>
      <NavBar
        title={data?.author}
        leftText="返回"
        onClickLeft={() => window.history.back()}
      />
      <Card round>
        <Card.Header extra={<Arrow />}>{data?.name}</Card.Header>
        <Card.Body>
          <div> {data?.phone}</div>
          <Card.Cover>
            {/* <Image src='/demo_view_1.png' />
             */}
            {data && (
              <Swiper autoplay={5000}>
                {data?.imageUrlList?.map((item) => {
                  return (
                    <Swiper.Item>
                      <img
                        src={"/api" + item}
                        alt="lalla"
                        className={style.imgname}
                      ></img>
                    </Swiper.Item>
                  );
                })}
              </Swiper>
            )}
          </Card.Cover>
          {/* <div></div> */}
          <div style={{ textAlign: "center" }}>{data?.workTime}</div>
          <div style={{ textAlign: "center" }}>{data?.specialService}</div>
          <div style={{ textAlign: "center" }}>{data?.internalFacilities}</div>

          <div style={{ textAlign: "center" }}>{data?.introduce}</div>
       
        </Card.Body>
      </Card>
     <Cell className={style.buy}>   <Button type='primary' block round>
        立即购买
      </Button></Cell>
    </div>
  );
}
/*


 */
